package com.frogs.ucenter.v1.request;

import javax.servlet.http.HttpServletRequest;

import com.frogs.framework.util.StringUtil;
import com.frogs.framework.web.HttpRequestInfo;
import com.frogs.system.util.ApiUrlParamEnum;
import com.frogs.system.util.OpenPlatformEnum;
import com.frogs.system.web.api.request.Request;
import com.frogs.system.web.exception.RequestIllegalException;

/**
 * 标签信息添加参数类
 *
 * @author hongyuhao
 * @version 2014年3月15日 - 上午9:58:28
 */
public class UserAttentionDeleteRequest extends Request {

	/**
	 * 
	 */
	private static final long serialVersionUID = -1925725392160982735L;
	
	private Integer followedUserId;
	
	private Integer followUserId;
	
	private Integer openPlatformId;
	
	private String ids;
	
	/** */
	public UserAttentionDeleteRequest() {
		
	}
	
	@Override
	public void parse(HttpServletRequest request) {
		
		HttpRequestInfo requestInfo = new HttpRequestInfo(request);
		
		this.followedUserId = requestInfo.getIntParameter(ApiUrlParamEnum.followedUserId.getParamName(),-1);
		this.followUserId = requestInfo.getIntParameter(ApiUrlParamEnum.followUserId.getParamName(), -1);
		this.openPlatformId = requestInfo.getIntParameter(ApiUrlParamEnum.openPlatformId.getParamName(), OpenPlatformEnum.WECHAT_HDC.getId());
		this.ids = requestInfo.getParameter(ApiUrlParamEnum.ids.getParamName(), "");
		if (followUserId < 1) {
			throw new RequestIllegalException("error followUserId: " + followUserId);
		}
		
		if (followedUserId < 1 && StringUtil.isEmpty(ids)) {
			throw new RequestIllegalException("error followedUserId or ids");
		}
	}

	public Integer getFollowedUserId() {
		return followedUserId;
	}

	public void setFollowedUserId(Integer followedUserId) {
		this.followedUserId = followedUserId;
	}

	public Integer getFollowUserId() {
		return followUserId;
	}

	public void setFollowUserId(Integer followUserId) {
		this.followUserId = followUserId;
	}

	public Integer getOpenPlatformId() {
		return openPlatformId;
	}

	public void setOpenPlatformId(Integer openPlatformId) {
		this.openPlatformId = openPlatformId;
	}

	public String getIds() {
		return ids;
	}

	public void setIds(String ids) {
		this.ids = ids;
	}
	
}
